package ccg;

import utils.FileUtil;
import utils.GetFileEncodingByPath;

import java.io.File;
import java.util.List;

public class Txt {
    public static void main(String[] args) {
        File file = new File("C:\\Users\\jinghe\\Desktop\\2006-2020年报TXT");
        File[] files = file.listFiles();
        for (File file1 : files) {
            String coding = GetFileEncodingByPath.getEncodingByPath(file1.getPath());
            List<String> data = FileUtil.readFileData(file1.getPath(), coding);
            FileUtil.writerFile(file1.getPath().replace("2006-2020年报TXT", "新2006-2020年报TXT"), data);
        }
    }
}
